Office Hours Topics
API Development & Testing
- How to write tests with requests_mock
- Useful methods for requests_mock (e.g. called, call_count)
- Exception handling for request errors
- API authentication and OAuth
- API keys (best practices and keeping them secure)
- Using APIs effectively (examples: GPT, Spotify, Slack, NBA API)
- PUT vs POST requests
- Other types of API architecture (SOAP, RPC, gRPC, etc.)
- Websockets and why they are used for real-time communication
- Multiprocessing (how it works, implementation, use with APIs)
Error Handling & Data Validation
- JSONDecodeError
- Error handling when extracting data from JSON/dicts with varying keys
- Best practice for accessing deeply nested JSON/dict data
- Exception handling for tricky issues
- Common mistakes that crop up in code reviews
Command Line Interfaces (CLI)
- Argparse (walkthrough, best practices, handling errors, creating a CLI)
- Is there a way to test command line arguments with pytest?
- Helper functions (when and how to use them)
Testing & Mocking
- patch and MagicMock
- With statements
- Benefits of functional approaches (map, filter, etc.)
- Examples of exporting output as JSON and HTML (and should we test these?)
Python Data Structures & Language Features
- Tuples and sets (comparisons, how they work)
is invsin- exec() and eval() (how they work, when to use them, best practice)
- Regex (why it looks complex, how to use it, e.g. generalising a mock API GET request)
- File handling (saving to specific paths, exporting data)
- At what point to start thinking about Big O (and what it is)
Rich Library (Terminal Output)
- Overview of the Rich library
- Best practices for printing to the terminal with Rich (and what to avoid)
- Changing console themes with Rich
- Console() in Rich and how to use it
Networking & Internet Fundamentals
- Overview of internet infrastructure (routers, DNS, IPs, ISPs)
- NAT vs DNS
- Public DNS (e.g. 8.8.8.8) - what it is and when to use it
- VPNs (how they work, why they allow access to blocked sites)
- What is Cloudflare? (DNS and more)
- Ports and protocols overview (UDP, TCP, SMTP, etc.)
- Packets and packet switching
- Data security over the internet (how secure is it, what improves it)
Code Quality & Tooling
- How pylint calculates code coverage and scoring in assessments